/**
 * @Author YuanYuan
 * @Date 2022/9/14
 * @Time 13:36
 */
/**
 * 有三个线程，线程名称分别为：a，b，c。
 *
 * 每个线程打印自己的名称。

 * 需要让他们同时启动，并按 c，b，a的顺序打印
 * @return
*/
public class TestDemo {
    public static void main(String[] args) {
        Thread tc = new Thread(()-> {
            System.out.println(Thread.currentThread().getName());
        },"c");



        Thread tb = new Thread(()-> {
            try {
                tc.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"b");

        Thread ta = new Thread(()-> {
            try {
                tb.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"a");


        ta.start();
        tb.start();
        tc.start();
    }
}
